<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8"></meta>
        <title>管理界面</title>
        <!--<meta http-equiv="refresh" content="2">-->
        <link rel = "stylesheet" href ="/static/bootstrap-3.4.1-dist/css/bootstrap.css">
        <script src ="/static/jquery-3.5.1.min.js"></script>
        <script src ="/static/bootstrap-3.4.1-dist/js/bootstrap.js"></script>
        <script src="/static/deleteUser.js"></script>
        <script src="/static/addUserModal.js"></script>
        <script src = "/static/showUser.js"></script>
        <script src = "/static/updatepas.js"></script>
        <script src = "/static/addBillModal.js"></script>
        <script src = "/static/getTime.js"></script>
        <script src = "/static/searchBill.js"></script>
        <script src = "/static/deletebill.js"></script>
        <script src = "/static/upbill.js"></script>
        <script src = "/static/searchUser.js"></script>
    </head>
<body>

<nav class="navbar navbar-default">
    <div class="container-fluid">
      <!-- Brand and toggle get grouped for better mobile display -->
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">账单管理系统</a>
      </div>
  
      <!-- Collect the nav links, forms, and other content for toggling -->
      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
        <ul class="nav navbar-nav">
          <li class="active"><a href="/user/list">用户信息展示 <span class="sr-only">(current)</span></a></li>
          <li class="active"><a href="/bill/list">账单信息展示 <span class="sr-only">(current)</span></a></li>
        </ul>
        <form class="navbar-form navbar-left" method="GET" id="searchForm">
          <div class="form-group">
            <input type="text" class="form-control" id="remark" placeholder="备注名",name = "remark">
          </div>
          <button type="button" class="btn btn-default" onclick="searchBills()">搜索账单</button>
          <button type="button" class="btn btn-default" onclick="searchUsers()">搜索用户</button>
        </form>
        <ul class="nav navbar-nav navbar-right">
          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{get_name()}} <span class="caret"></span></a>
            <ul class="dropdown-menu">
              <li><a type ='button' href="/user" class= "get-data" data-id = '{{ get_user_id() }}'>个人中心</a></li>
              <li><a href="/logout">退出登录</a></li>
            </ul>
          </li>
        </ul>
      </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
  </nav>

  <script>
    document.querySelector('.get-data').addEventListener('click', function(e) {
      e.preventDefault();
      var ID = this.getAttribute('data-id');
      window.location.href = '/user/' + ID;
    });
  </script>

<div class="container">
    {%block body%}
    {%endblock%}

</div>
</body>    
</html>